]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screencast: Use the same format for screencasts and screenshot file names
authorEmmanuele Bassi <ebassi@gnome.org>
Fri, 20 May 2022 16:40:35 +0000 (17:40 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 27 Jul 2022 13:50:10 +0000 (13:50 +0000)
Screenshots use `%Y-%m-%d %H-%M-%S` for the timestamp, which has the
advantage of allowing proper lexicographical sorting.

The screencast file name pattern, on the other hand, uses
locale-dependent expansions, which break sorting based on file name, and
introduces the chance of potentially invalid characters on different
file systems.

Fixes: #5115
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2300>

js/dbusServices/screencast/screencastService.js

index 73f6b5595e071938da752dd9f4424f7e08fc79f8..6f348c9d9c2e8ebe6e33ae9a7a560b20af0c0f57 100644 (file)
@@ -308,19 +308,17 @@ var ScreencastService = class extends ServiceImplementation {
                     break;
                 case 'd': {
                     const datetime = GLib.DateTime.new_now_local();
-                    const datestr = datetime.format('%0x');
-                    const datestrEscaped = datestr.replace(/\//g, '-');
+                    const datestr = datetime.format('%Y-%m-%d');
 
-                    filename += datestrEscaped;
+                    filename += datestr;
                     break;
                 }
 
                 case 't': {
                     const datetime = GLib.DateTime.new_now_local();
-                    const datestr = datetime.format('%0X');
-                    const datestrEscaped = datestr.replace(/\//g, ':');
+                    const datestr = datetime.format('%H-%M-%S');
 
-                    filename += datestrEscaped;
+                    filename += datestr;
                     break;
                 }